From: | DonaldWM |
Date: | 20 Aug 99 at 18:54:43 |
Subject: | Dynamic Database |
From: DonaldWM@stonelawdrive.freeserve.co.uk
For the past six months, I have been trying to think of a way to create a database, which like commercial ones, can accept user input on the required structure and then create it all ready for input. I have a (nearly) full understanding of C and C++ but can't solve this problem.
Does anyone know if it is actually possible to do this at all?
I include a fuller explanation and example below.
/* Dynamic Database idea and code Copyright (C) DWM Productions 1999.
The code is supposed to begin with an array of char and an array of int.(This program would be implemented in Storm C/C++ in Intuition).
The char array will contain the names of the fields and the int array will contain the type (identified by a number). The type will be decided by a radio button gadget. The user chooses the button which indicates the required type. Each button would be assigned a number which would be entered in the the array of int.
When creating the record structure when the program is running, an array of char would be declared to hold the
name of the field and another variable would be created according to the previously chosen type.
Once a basic record structure was created, an array or like structure would be created to hold many records of the created type.
I know how to create the intuition window, gadgets, and all about C and C++ 's dynamic data structures, etc., but I don't know if C or C++ allow variables and structures to be just invented with no prior declaration. I have created the program sketch below to show the general idea. */
#include <various header files>
void
main()
{
}
structure_type
structure_create(int no_of_fields, int types[], char names[])
{
return(structure_type);
}